---
# Configuration for the summershum consumer

- name: install needed packages
  yum: pkg={{ item }} state=installed
  with_items:
  - python-summershum
  - python-psycopg2
  - python-sqlalchemy0.8

- name: ensure summershum has a place to unpack files
  file: >
    dest=/var/cache/summershum
    state=directory
    mode=0755
    owner=fedmsg
    group=fedmsg

- name: copy database configuration
  template: >
    src={{ item }} dest=/etc/fedmsg.d/{{ item }}
    owner=fedmsg group=fedmsg mode=0600
  with_items:
  - summershum.py
  notify:
  - restart fedmsg-hub

# Here I'm "permanently" hotfixing the fedmsg-hub
# It needs to load the forward-compat sqlalchemy0.7 package from the get-go.
- name: copy over patched fedmsg-hub
  copy: >
    src=patched-fedmsg-hub dest=/usr/bin/fedmsg-hub
    owner=root group=root mode=0755
  tags:
  - patches
  - hotfix
  notify:
  - restart fedmsg-hub
